// 请求数据分发

interface commit {

    action?: string,
    commit?: string,
    propPath: string,
    
}

interface commits{
    [propname:string]: commit[]
}


const CONF:commits = {

     // 登录
     [`post/token/id`]: [

        {
            commit: 'mainStore/updateUserBase',
            propPath: '*'
        },
        {
            action: 'mainStore/setPowerConf',
            propPath: 'acl'
        },
        
     ],

    //  密码修改
     [`patch/users/id/password`]:[

        {
            commit: 'empty',
            propPath: '*'
        }

     ],

      //刷新后登录用户数据 
      [`get/users/id?token=current`]: [

        {
            commit: 'mainStore/updateUserBase',
            propPath: '*'
        },
        
     ],

    //  车险订单列表
     ['get/orders']: [

         {
             commit: 'carTableStore/updateTableOrders',
             propPath: '*'
         }

    ],

    // 车险订单数据
    [`get/orders/id`]: [

        
        {
            commit: 'carFormStore/updateCarModels',
            propPath: 'carModels'
        },
        {
            commit: 'carFormStore/updateDquotations',
            propPath: 'orderData-Dquotations'
        },
        {
            commit: 'carFormStore/allotReqOrderData',
            propPath: 'orderData'
        },
        
    ],
    
    // 车型列表
    [`get/car_modules`]: [

        {
            commit: 'carFormStore/updateCarModels',
            propPath: '*'
        }
        
    ],

     // 计费结果
     [`get/bill/id`]: [

        {
            commit: 'carFormStore/updateDquotations',
            propPath: 'quotations'
        },
        {
            commit: 'carFormStore/updateChargingCode',
            propPath: 'chargingCode'
        }
        
    ],

    // 查询出险率
    ['get/danger_rate']:[
        {
            commit: 'carFormStore/updateDanger',
            propPath: '*'
        }
    ],

    // 提交订单数据
    ['patch/orders/id']:[
        {
            commit: 'carFormStore/pushNewOrderId',
            propPath: 'orderId'
        }
    ],

    // 修改订单状态
    ['patch/order/id/status']:[
        {
            commit: 'empty',
            propPath: '*'
        } 
    ],

    // 上传附件
    ['post/files/id']:[
        {
            commit: 'empty',
            propPath: '*'
        }
    ],
    
    // 删除附件
    ['delete/files/id']:[
        {
            commit: 'empty',
            propPath: '*'
        }
    ],

    //附件列表
    [`get/files`]: [

        {
            commit: 'carFormStore/updateCarUploadList',
            propPath: '*'
        }
        
    ],

    // 单证列表
    [`get/printList`]:[

        {
            commit: 'carFormStore/updateIndiaOrderInfo',
            propPath: 'orderDesc'
        },
        {
            commit: 'carFormStore/updateIndiaSingle',
            propPath: 'singleInfo'
        }
        
    ],

    // 获取单证
    [`get/single`]: [

        {
            commit: 'carFormStore/updateSingleNumber',
            propPath: '*'
        },
        {
            commit: 'carFormStore/clearCurrentSingleType',
            propPath: '*'
        }
        
    ],

    // 删除单证
    [`delete/single/id`]: [
        {
            commit: 'carFormStore/deleteSingleNumber',
            propPath: '*'
        },
        {
            commit: 'carFormStore/clearCurrentSingleType',
            propPath: '*'
        }
    ],

    // 可用单证
    [`get/usableSingles`]: [
        {
            commit: 'carFormStore/issueUsableSingle',
            propPath: '*'
        }
    ],

    // 集印(修改单证状态)
    [`post/india/id`]: [
        {
            commit: 'carFormStore/toIndiaSingleNumber',
            propPath: '*'
        }
    ],

    // 修改单证状态
    [`patch/single/id`]: [
        {
            commit: 'empty',
            propPath: '*'
        }
    ],

    // 打单(修改单证状态)
    [`post/intimidate/id`]: [
        {
            commit: 'toIntimidateSingleNumber',
            propPath: '*'
        }
    ],

    // 获取公司列表（包含部门数据）
    [`get/companys`]: [
        {
            commit: 'organizationStore/updateCompanys',
            propPath:'*'
        }
    ],


    // 用户列表
    [`get/users`]: [

        {
            commit: 'organizationStore/updatePersonalList',
            propPath:'*'
        }
        
    ],
    
    // 获取部门明细
    [`get/departments/id`]:[
        
        {
            commit: 'organizationStore/updataCurrentLoadFormData',
            propPath: '*'
        }

    ],

    // 获取公司明细
    [`get/companys/id`]:[
        
        {
            commit: 'organizationStore/updataCurrentLoadFormData',
            propPath: '*'
        }

    ],

    // 用户明细
    [`get/users/id`]:[

        {
            commit: 'organizationStore/updataCurrentLoadFormData',
            propPath: '*'
        }  
    ],

    // 提交部门审核
    [`post/departments/id`]: [

        {
            commit: 'empty',
            propPath: '*'
        }
        
    ],

    // 提交公司审核
    [`post/companys/id`]: [

        {
            commit: 'empty',
            propPath: '*'
        }
        
    ],

    // 提交人员审核
    [`post/users/id`]: [

        {
            commit: 'empty',
            propPath: '*'
        }
        
    ],

    // 获取部门 人员审核列表
    [`get/auditings`]: [

        {
            commit: 'auditingStore/updateTableOrders',
            propPath: '*'
        }
        
    ],

    // 部门人员审核
    [`patch/auditings/id/status`]: [

        {
            commit: 'empty',
            propPath: '*'
        }
        
    ],
    

    // 权限预设配置
    [`get/power_list`]: [

        {
            commit: 'modConf/setPowerPreConf',
            propPath: '*'
        }
        
    ]

    
};

export default CONF;

